local remove=table.remove
module(..., package.seeall)

local Queue= {}
local Queue_mt = {__metatable = {}, __index = Queue}


function new(params)
	local obj = setmetatable({lst={}}, Queue_mt)
	return obj
end

function Queue:Put(pkg)
	table.insert(self.lst,1,pkg)
end

function Queue:Get()
	local cnt=#self.lst
	if cnt>0 then
		return remove(self.lst,cnt)
	end
	return nil
end

function Queue:Count()
	return #self.lst
end

function Queue:Clear()
	lst={}
end
